//警告：这是自动生成的代码，不要手动去修改.
//使用 wrapCLI 工具生成，工具版本为 <0.1.6>.

#include <cstdint>
namespace TTFramework {
    int LoadDLL();
//自定义类型 
    typedef void (*deleOnInit)();
    typedef void (*deleOnUpdate)();
    typedef void (*deleOnWinRender)(int winid);
    typedef void (*deleOnExit)();
    typedef void (*deleOnLog)(char16_t* log);
    typedef void (*deleOnMouseMotion)(int winid,int x,int y,bool press);
    typedef void (*deleOnMouseButton)(int winid,int x,int y,uint8_t buttonid,bool press,uint8_t click);
    typedef void (*deleOnMouseWheel)(int winid,int sx,int sy,bool flipped);
    typedef void (*deleOnKey)(int winid,int scancode,int keycode,bool press,uint8_t repeat);
    typedef void (*deleOnInput)(int winid,char16_t* input);
    typedef void (*deleOnInputEdit)(int winid,char16_t* input,int pos,int length);
    typedef void (*deleOnKeyInputKeymapChange)();
    typedef void (*deleOnTouchEvent)(int winid,int touchid,int fingerid,float x,float y,float dx,float dy,float pressure);
    struct Target{
    };
    struct Texture{
    };
    struct Material{
    };
    struct Mesh{
    };
    struct XYWH{
        int x;
        int y;
        int w;
        int h;
    };
    struct Vector4{
        float x;
        float y;
        float z;
        float w;
    };
    enum UniformType{
        Sampler ,
        End ,
        Vec4 ,
        Mat3 ,
        Mat4 ,
        Count ,
    };
    enum VertexFormat{
        Nothing ,
        Pos ,
        Pos_Color0 ,
        Pos_UV0_Color0 ,
        Pos_UV0_UV1_Color0_Color1 ,
        Pos_UV0_UV1_UV2_Color0_Color1_Color2 ,
        Pos_UV0_UV1_UV2_UV3_Color0_Color1_Color2_Color3 ,
    };
    typedef unsigned short uint16_t;
    typedef unsigned int uint32_t;
    typedef unsigned long long uint64_t;
    typedef unsigned short uint16_t;
    typedef unsigned int uint32_t;
    typedef unsigned __int16 uint16_t;
    typedef unsigned __int32 uint32_t;
    typedef unsigned __int64 uint64_t;
//函数 
    typedef void (*deleAPP_SetLogger)(deleOnLog logger);
    extern deleAPP_SetLogger APP_SetLogger;
    typedef int (*deleApp_MainLoop)(char16_t* title,deleOnInit onInit,deleOnUpdate onUpdate,deleOnWinRender onWinRender,deleOnExit onExit);
    extern deleApp_MainLoop App_MainLoop;
    typedef int (*deleEditor_MainLoop)(char16_t* title,void* windowHandler);
    extern deleEditor_MainLoop Editor_MainLoop;
    typedef int (*deleGetFocusWindowID)();
    extern deleGetFocusWindowID GetFocusWindowID;
    typedef int (*deleGetMousePos)(int* x,int* y);
    extern deleGetMousePos GetMousePos;
    typedef void (*deleEvents_RegMouse)(deleOnMouseMotion onMouseMotion,deleOnMouseButton onMouseButton,deleOnMouseWheel onMouseWheel);
    extern deleEvents_RegMouse Events_RegMouse;
    typedef void (*deleEvents_RegKey)(deleOnKey onKeyPress,deleOnInput OnInput,deleOnInputEdit OnInputEdit,deleOnKeyInputKeymapChange OnKeyInputKeymapChange);
    extern deleEvents_RegKey Events_RegKey;
    typedef void (*deleEvents_RegTouch)(deleOnTouchEvent onTouchMotion,deleOnTouchEvent onTouchDown,deleOnTouchEvent onTouchUp);
    extern deleEvents_RegTouch Events_RegTouch;
    typedef int (*deleWindow_GetMainWinID)();
    extern deleWindow_GetMainWinID Window_GetMainWinID;
    typedef int (*deleWindow_Create)(char16_t* title,bool borderless);
    extern deleWindow_Create Window_Create;
    typedef bool (*deleWindow_Exists)(int winid);
    extern deleWindow_Exists Window_Exists;
    typedef bool (*deleWindow_SetPos)(int winid,int x,int y,int w,int h);
    extern deleWindow_SetPos Window_SetPos;
    typedef bool (*deleWindow_GetPos)(int winid,int& x,int& y,int& w,int& h);
    extern deleWindow_GetPos Window_GetPos;
    typedef bool (*deleWindow_Destory)(int winid);
    extern deleWindow_Destory Window_Destory;
    typedef Target* (*deleTarget_Create)(uint32_t width,uint32_t height);
    extern deleTarget_Create Target_Create;
    typedef void (*deleTarget_Destory)(Target* handle);
    extern deleTarget_Destory Target_Destory;
    typedef void (*deleTarget_Reset)(Target* handle,int width,int height);
    extern deleTarget_Reset Target_Reset;
    typedef void (*deleMainScreen_Reset)(int width,int height);
    extern deleMainScreen_Reset MainScreen_Reset;
    typedef void (*deleFrame_BeginRender)(void* winHandle,int width,int height);
    extern deleFrame_BeginRender Frame_BeginRender;
    typedef void (*deleFrame_EndRender)();
    extern deleFrame_EndRender Frame_EndRender;
    typedef void (*deleFrame_Clear)(uint32_t color,bool withColor,bool withDepth);
    extern deleFrame_Clear Frame_Clear;
    typedef void (*deleFrame_Draw)(Material* mat,Mesh* mesh);
    extern deleFrame_Draw Frame_Draw;
    typedef void (*deleFrame_Begin)();
    extern deleFrame_Begin Frame_Begin;
    typedef void (*deleFrame_Flush)();
    extern deleFrame_Flush Frame_Flush;
    typedef Texture* (*deleTexture_LoadFromFile)(char16_t* filename);
    extern deleTexture_LoadFromFile Texture_LoadFromFile;
    typedef Texture* (*deleTexture_LoadFromMem)(char* mem,uint32_t size);
    extern deleTexture_LoadFromMem Texture_LoadFromMem;
    typedef Texture* (*deleTexture_Create)(uint32_t width,uint32_t height);
    extern deleTexture_Create Texture_Create;
    typedef void (*deleTexture_Upload)(Texture* texture,XYWH xywh,char* mem,int size);
    extern deleTexture_Upload Texture_Upload;
    typedef void (*deleTexture_Destory)(Texture* handle);
    extern deleTexture_Destory Texture_Destory;
    typedef Material* (*deleMaterial_CreateDefault)();
    extern deleMaterial_CreateDefault Material_CreateDefault;
    typedef Material* (*deleMaterial_CreateDefaultOutline)();
    extern deleMaterial_CreateDefaultOutline Material_CreateDefaultOutline;
    typedef Material* (*deleMaterial_CreateDefaultTexture)();
    extern deleMaterial_CreateDefaultTexture Material_CreateDefaultTexture;
    typedef Material* (*deleMaterial_Create)(char16_t* shadername);
    extern deleMaterial_Create Material_Create;
    typedef void (*deleMaterial_Destory)(Material* material);
    extern deleMaterial_Destory Material_Destory;
    typedef int (*deleMaterial_GetUniformCount)(Material* material);
    extern deleMaterial_GetUniformCount Material_GetUniformCount;
    typedef char16_t* (*deleMaterial_GetUniformName)(Material* material,int index,char16_t* namebuf,int bufsize);
    extern deleMaterial_GetUniformName Material_GetUniformName;
    typedef uint64_t (*deleMaterial_GetUniformNameHash)(Material* material,int index);
    extern deleMaterial_GetUniformNameHash Material_GetUniformNameHash;
    typedef UniformType (*deleMaterial_GetUniformType)(Material* material,int index);
    extern deleMaterial_GetUniformType Material_GetUniformType;
    typedef void (*deleMaterial_SetTexture)(Material* material,int uniformID,Texture* texture);
    extern deleMaterial_SetTexture Material_SetTexture;
    typedef void (*deleMaterial_SetVec4)(Material* material,int uniformID,Vector4 value);
    extern deleMaterial_SetVec4 Material_SetVec4;
    typedef Mesh* (*deleMesh_CreateSample)();
    extern deleMesh_CreateSample Mesh_CreateSample;
    typedef Mesh* (*deleMesh_Create)(VertexFormat format,int vertexCount,int triCount,char* memVB,uint16_t* memIB);
    extern deleMesh_Create Mesh_Create;
    typedef void (*deleMesh_Destory)(Mesh* handle);
    extern deleMesh_Destory Mesh_Destory;
    typedef int (*deleMesh_GetVertexStride)(Mesh* handle);
    extern deleMesh_GetVertexStride Mesh_GetVertexStride;
    typedef Mesh* (*deleMeshDynamic_Create)(VertexFormat format,int vertexCount,int triCount);
    extern deleMeshDynamic_Create MeshDynamic_Create;
    typedef void (*deleMeshDynamic_UploadVertex)(Mesh* mesh,int VertexStart,int VertexCount,char* mem);
    extern deleMeshDynamic_UploadVertex MeshDynamic_UploadVertex;
    typedef void (*deleMeshDynamic_UploadIndex)(Mesh* mesh,int IndexStart,int IndexCount,uint16_t* indexdata);
    extern deleMeshDynamic_UploadIndex MeshDynamic_UploadIndex;
    typedef void (*deleMatrix_Test)();
    extern deleMatrix_Test Matrix_Test;
    typedef void (*deleMatrix_SetViewProj)(float* view,float* proj);
    extern deleMatrix_SetViewProj Matrix_SetViewProj;
    typedef void (*deleMatrix_SetModel)(float* model);
    extern deleMatrix_SetModel Matrix_SetModel;
    typedef void (*deleMatrix_GenIdentity)(float* matresult);
    extern deleMatrix_GenIdentity Matrix_GenIdentity;
    typedef void (*deleMatrix_GenOrtho)(float* matresult,float left,float right,float bottom,float top,float near,float far);
    extern deleMatrix_GenOrtho Matrix_GenOrtho;
    typedef void (*deleMatrix_GenProj)(float* matresult,float fov,float asp,float near,float far);
    extern deleMatrix_GenProj Matrix_GenProj;
    typedef void (*deleMatrix_GenViewLookAt)(float* matresult,float* eys,float* to);
    extern deleMatrix_GenViewLookAt Matrix_GenViewLookAt;
    typedef void (*deleMatrix_GenRotate)(float* matresult,float x,float y,float z);
    extern deleMatrix_GenRotate Matrix_GenRotate;
}
